/** 基础信息 */

import React from 'react'
import {
	Form,
	Row,
	Col,
	Input,
	Select,
	DatePicker,
	Cascader,
	InputNumber,
} from 'antd'

const {TextArea} = Input
const {Option} = Select

// 城市
const cityNames = {
	label: 'name',
	value: 'id',
	children: 'cityInfoList',
}

const basicInformation = (props: any) => {
	const {data, dictData, citysList} = props
	return (
		<div>
			<Form
				name="basic"
				layout="horizontal"
				labelCol={{flex: '140px'}}
				labelAlign="right"
				labelWrap
				initialValues={data}
				autoComplete="off"
				disabled>
				{data?.gysType === 'sp' ? (
					<Row gutter={12}>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="企业法人" name="legalPerson">
								<Input placeholder="-" />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="渠道负责人" name="channelLeader">
								<Input placeholder="-" />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="负责人电话" name="leadingPhone">
								<Input placeholder="-" />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="常用地址" name="address">
								<Input placeholder="-" />
							</Form.Item>
						</Col>
						{/* <Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="固定电话" name="linePhone">
								<Input placeholder="-" />
							</Form.Item>
						</Col> */}
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="代理业务" name="agencyService">
								<Select
									allowClear
									fieldNames={{
										value: 'dictKey',
										label: 'dictValue',
									}}
									options={dictData?.Agency_Business}
								/>
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="合作模式" name="cooperationMode">
								<Select
									allowClear
									fieldNames={{
										value: 'dictKey',
										label: 'dictValue',
									}}
									options={dictData?.Cooperation_Mode}
								/>
							</Form.Item>
						</Col>
						{/* <Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="业务模式" name="businessModel">
								<Select
									allowClear
									fieldNames={{
										value: 'dictKey',
										label: 'dictValue',
									}}
									options={dictData?.Business_Model}
								/>
							</Form.Item>
						</Col> */}
						{/* <Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="公司类型" name="companyType">
								<Select
									allowClear
									fieldNames={{
										value: 'dictKey',
										label: 'dictValue',
									}}
									options={dictData?.Company_Type}
								/>
							</Form.Item>
						</Col> */}
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="渠道类型" name="channelType">
								<Select
									allowClear
									fieldNames={{
										value: 'dictKey',
										label: 'dictValue',
									}}
									options={dictData?.Channel_Type}
								/>
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="渠道标签" name="channelLabel">
								<Input placeholder="-" />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="结算周期" name="settlementCycle">
								<Select
									allowClear
									fieldNames={{
										value: 'dictKey',
										label: 'dictValue',
									}}
									options={dictData?.Settlement_Cycle}
								/>
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="税率" name="taxRate">
								<Select
									allowClear
									fieldNames={{
										value: 'dictKey',
										label: 'dictValue',
									}}
									options={dictData?.Invoicing_Tax_Rate}
								/>
							</Form.Item>
						</Col>
						{/* <Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="是否有子账户" name="subAccount">
								<Select allowClear>
									<Option value={1}>是</Option>
									<Option value={2}>否</Option>
								</Select>
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item
								label="开设子账户的条件"
								name="accountConditions">
								<Input placeholder="-" />
							</Form.Item>
						</Col> */}
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="结算方式" name="settlementMethod">
								<Select
									allowClear
									fieldNames={{
										value: 'dictKey',
										label: 'dictValue',
									}}
									options={dictData?.SP_Settlement_Method}
								/>
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="保证金金额" name="earnestMoney">
								<InputNumber
									formatter={(value) => `${value}元` || ''}
									max={1000000000}
									addonAfter="元"
									placeholder="-"
								/>
							</Form.Item>
						</Col>
					</Row>
				) : (
					''
				)}
				{data?.gysType === 'other' || data?.gysType === 'cs' ? (
					<Row gutter={12}>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="企业性质" name="enterpriseNature">
								<Select
									allowClear
									fieldNames={{
										value: 'dictKey',
										label: 'dictValue',
									}}
									options={dictData?.Enterprise_Nature}
								/>
							</Form.Item>
						</Col>
						{data?.gysType === 'other' ? (
							<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
								<Form.Item label="注册城市" name="city">
									<Cascader
										fieldNames={cityNames}
										options={citysList}
									/>
								</Form.Item>
							</Col>
						) : (
							''
						)}
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="常用地址" name="address">
								<Input placeholder="-" />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="付款条件" name="payCondition">
								<Select
									allowClear
									fieldNames={{
										value: 'dictKey',
										label: 'dictValue',
									}}
									options={dictData?.Term_Payment}
								/>
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="开票税率" name="invoicingRate">
								<Select
									allowClear
									fieldNames={{
										value: 'dictKey',
										label: 'dictValue',
									}}
									options={dictData?.Invoicing_Tax_Rate}
								/>
							</Form.Item>
						</Col>
						{data?.gysType === 'cs' ? (
							''
						) : (
							<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
								<Form.Item label="固定电话" name="telephone">
									<Input placeholder="-" />
								</Form.Item>
							</Col>
						)}

						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="联系人" name="contacts">
								<Input placeholder="-" />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="联系人手机" name="mobilePhone">
								<Input placeholder="-" />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="联系人邮箱" name="email">
								<Input placeholder="-" />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item
								label="注册资本"
								name="registeredCapital">
								<InputNumber
									formatter={(value) => `${value}元` || ''}
									max={1000000000}
									addonAfter="元"
									placeholder="-"
								/>
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="成立日期" name="establishDate">
								<DatePicker />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="邮编" name="postalCode">
								<Input placeholder="-" />
							</Form.Item>
						</Col>
						{data?.gysType === 'cs' ? (
							<>
								{' '}
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="结算方式"
										name="settlementMethod">
										<Select
											placeholder="-"
											allowClear
											fieldNames={{
												value: 'dictKey',
												label: 'dictValue',
											}}
											options={
												dictData?.CS_Settlement_Method
											}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="保证金金额"
										name="earnestMoney">
										<InputNumber
											formatter={(value) =>
												`${value}元` || ''
											}
											max={1000000000}
											addonAfter="元"
											placeholder="-"
										/>
									</Form.Item>
								</Col>
							</>
						) : (
							''
						)}
						<Col span={24}>
							<Form.Item
								label="公司简介"
								name="companyIntroduction">
								<TextArea
									maxLength={200}
									placeholder="-"
									autoSize={{minRows: 2, maxRows: 6}}
								/>
							</Form.Item>
						</Col>
					</Row>
				) : (
					''
				)}
				{data?.gysType === 'cz' ? (
					<Row gutter={12}>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="企业性质" name="enterpriseNature">
								<Select
									allowClear
									fieldNames={{
										value: 'dictKey',
										label: 'dictValue',
									}}
									options={dictData?.Enterprise_Nature}
								/>
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="注册城市" name="city">
								<Cascader
									fieldNames={{
										label: 'name',
										value: 'id',
										children: 'cityInfoList',
									}}
									options={citysList}
								/>
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="成立日期" name="establishDate">
								<DatePicker />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item
								label="从事汽车，二手车业务时间"
								name="automobileBusinessTime">
								<DatePicker />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item
								label="近一年月均二手车交易量"
								name="carTransactionVolume">
								<InputNumber
									formatter={(value) => `${value}台/月`}
									addonAfter="台/月"
									placeholder="-"
								/>
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="总部/区域" name="headquarters">
								<Cascader
									fieldNames={{
										label: 'name',
										value: 'id',
										children: 'cityInfoList',
									}}
									options={citysList}
								/>
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="品类" name="category">
								<Select
									allowClear
									fieldNames={{
										value: 'dictKey',
										label: 'dictValue',
									}}
									options={dictData?.Category}
								/>
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="开票税率" name="invoicingRate">
								<Select
									allowClear
									fieldNames={{
										value: 'dictKey',
										label: 'dictValue',
									}}
									options={dictData?.Invoicing_Tax_Rate}
								/>
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="联系人" name="contacts">
								<Input placeholder="-" />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="联系人手机" name="mobilePhone">
								<Input placeholder="-" />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="联系人邮箱" name="email">
								<Input placeholder="-" />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="常用地址" name="address">
								<Input placeholder="-" />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item label="邮编" name="postalCode">
								<Input placeholder="-" />
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item
								label="公司和法人是否有违法违规记录"
								name="isIllegal">
								<Select allowClear>
									<Option value={1}>是</Option>
									<Option value={2}>否</Option>
								</Select>
							</Form.Item>
						</Col>
						<Col sm={{span: 24}} md={{span: 12}} lg={{span: 8}}>
							<Form.Item
								label="公司目前是否有债务财务纠纷"
								name="isFinancialEmbroilment">
								<Select allowClear>
									<Option value={1}>是</Option>
									<Option value={2}>否</Option>
								</Select>
							</Form.Item>
						</Col>
						<Col span={16}>
							<Form.Item
								label="公司服务的主要企业或参与的重要项目"
								name="enterpriseProject">
								<TextArea
									maxLength={200}
									placeholder="-"
									autoSize={{minRows: 3, maxRows: 6}}
								/>
							</Form.Item>
						</Col>
						<Col span={16}>
							<Form.Item
								label="公司侧重/倾向于哪些车型的处置业务？"
								name="handleBusiness">
								<TextArea
									maxLength={200}
									placeholder="-"
									autoSize={{minRows: 3, maxRows: 6}}
								/>
							</Form.Item>
						</Col>
					</Row>
				) : (
					''
				)}
			</Form>
		</div>
	)
}

export default basicInformation
